package store.lunangangster.engine.impl.service;

import store.lunangangster.engine.ProcessEngineConfiguration;
import store.lunangangster.engine.impl.cmd.CommandExecutor;

public class ServiceImpl implements Service {

  protected ProcessEngineConfiguration processEngineConfiguration;
  protected CommandExecutor executor;   // executor用于Query对象的查询

  public ServiceImpl(ProcessEngineConfiguration processEngineConfiguration) {
    this.processEngineConfiguration = processEngineConfiguration;
    this.executor = processEngineConfiguration.getCommandExecutor();
  }

  @Override
  public ProcessEngineConfiguration getProcessEngineConfiguration() {
    return processEngineConfiguration;
  }

  @Override
  public CommandExecutor getCommandExecutor() {
    return executor;
  }

  public void setProcessEngineConfiguration(ProcessEngineConfiguration processEngineConfiguration) {
    this.processEngineConfiguration = processEngineConfiguration;
  }

  public void setExecutor(CommandExecutor executor) {
    this.executor = executor;
  }
}
